package com.networkapp;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;

import com.hu.network.http.bean.InnerResponseResult;
import com.hu.network.task.AbstractTask;
import com.hu.network.task.impl.SimpleGetTaskImpl;


public class MainActivity extends AppCompatActivity {

    private static final String TAG = "MainActivity";

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        View view = findViewById(R.id.button);
        view.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                new SimpleGetTaskImpl(MainActivity.this, null, true, "https://www.baidu.com", new AbstractTask.ITaskCallback<String>() {
                    @Override
                    public boolean onBefore() {
                        return true;
                    }

                    @Override
                    public void onResult(InnerResponseResult<String> innerResponseResult) {

                    }

                    @Override
                    public void onAfter() {

                    }
                }).excute();
            }
        });
    }
}
